import com.yan.Server.UserService;
import com.yan.Server.UserServiceImpl;
import com.yan.dao.UserDao;
import com.yan.dao.UserDaoMySql;
import com.yan.dao.UserDaoOracle;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MtYan {


    public static void main(String[] args) {

    //    UserService userService=new UserServiceImpl();
     //   UserServiceImpl userService=new UserServiceImpl();
      //  userService.getUser();

//        userService.setUserDao(new UserDaoOracle());
//        userService.getUser();
//
//        userService.setUserDao(new UserDaoMySql());
//        userService.getUser();

        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");

        UserServiceImpl dao = (UserServiceImpl) context.getBean("UserServiceImpl");
            dao.getUser();

    }
}
